﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace HHHFramework {
    /// <summary>
    /// 入口管理器
    /// 1、解决当要测试一个模块的时候需要同时加载运行其他模块  这里就会比较浪费时间  （通过在这里写一个跳转代码  跳过其他无用资源的加载问题） 出包或者进行完整测试的时候失效 对应 EnvironmentMode
    /// 
    /// </summary>

    public enum EnvironmentMode
    {
        Developing,
        Test,
        Release
    }
    public abstract class GameManager : MonoSingleton<GameManager>
    {
        /// <summary>
        /// 
        /// </summary>
        public EnvironmentMode environmentMode = EnvironmentMode.Developing;
        /// <summary>
        /// 共享mode 作用： 其他继承类会和他保持一致
        /// </summary>
        private static EnvironmentMode mSharedMode;
        private static bool mModeSetted = false;
        public void Ini()
        {
            
#if UNITY_EDITOR

#else
            environmentMode = EnvironmentMode.Release;
#endif
            if (!mModeSetted) {
                mSharedMode = environmentMode;
                mModeSetted = true;
            }


            switch (mSharedMode) {
                case EnvironmentMode.Developing:
                    {
                        //开发逻辑
                        LunchInDevelopingMode();
                    }
                    break;
                case EnvironmentMode.Test:
                    {
                        LunchInTestMode();
                    }
                    break;

                case EnvironmentMode.Release:
                    {
                        LunchInReleaseMode();
                    }
                    break;

            }


        }
        private void Start()
        {
            
        }
        /// <summary>
        /// 开发模式
        /// </summary>
        protected abstract void LunchInDevelopingMode();
        /// <summary>
        /// 测试模式模式
        /// </summary>
        protected abstract void LunchInTestMode();
        /// <summary>
        /// 发布模式模式
        /// </summary>
        protected abstract void LunchInReleaseMode();
        /// <summary>
        /// 必须实例化的信息
        /// </summary>
        protected abstract void MustInitialization();
    }
}

